#include<stdlib.h>
#include<stdio.h>
int main()
{
  //模拟僵尸进程
  pid_t id = fork();
  if(id<0)
  {
    //进程创建失败
    perror("fork");
    return 1;
  }
  else if(id>0)
  {
    //parent
    printf("parent[%d] is sleeping...\n",getpid());
    sleep(30);
  }
  else
  {
    //child
    printf("child[%d] is begin zombie...\n",getpid());
    sleep(5);
    exit(EXIT_SUCCESS);
  }

  return 0;
}
